package com.vic.dubbo.fanhua;

import com.alibaba.dubbo.rpc.service.GenericService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DubboConsumerGenericService {
    public static void main(String[] args) {
        /////////////////Spring泛化调用/////////
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                "dubbo-client.xml");
        context.start();

        GenericService easyCommonService = (GenericService) context.getBean("easyCommonService");
        Object result = easyCommonService.$invoke("helloService", new String[] { "java.lang.String" }, new Object[] { "hello" });
        System.out.println(result);

    }
}
